home *** CD-ROM | disk | FTP | other *** search
/ MacGames Sampler / PHT MacGames Bundle.iso / MacSource Folder / Samples from the CD / Editors / emacs / Emacs-1.14b1 / lisp / term / Macintosh-win.el
Encoding:
Text File  |  1994-05-19  |  4.8 KB  |  111 lines  |  [TEXT/EMAC]

  1. ;;;
  2. ;;; This file is part of a Macintosh port of GNU Emacs.
  3. ;;; Copyright (C) 1993, 1994 Marc Parmet.  All rights reserved.
  4. ;;;
  5. ;;; GNU Emacs is distributed in the hope that it will be useful,
  6. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  8. ;;; GNU General Public License for more details.
  9. ;;;
  10.  
  11. ;;;
  12. ;;; This file is read after .emacs is read at startup.
  13. ;;;
  14.  
  15. (require 'mac-runtime "mac/runtime")
  16.  
  17. (defvar mac-raw-map (make-keymap) "*Keymap for C-x * encoded keyboard")
  18.  
  19. ; The keyboard driver looks at the virtual key code for every keystroke.
  20. ; If the code is less than 100 octal, then the ASCII code for that key
  21. ; is passed up to Emacs.  If the code is greater than or equal to
  22. ; 100 octal, the sequence
  23. ;   C-x * virtual-code
  24. ; is passed up, with 100 octal subtracted from the virtual code.  If the
  25. ; shift key is held down, that 100 is not subtracted.
  26. ;
  27. ; This encoding will change as the needs and problems of keymapping on
  28. ; the Macintosh become better understood.
  29. ; Codes below are for ADB keyboards unless otherwise noted.
  30.  
  31. (define-key mac-raw-map "\000" nil) ; no such key
  32. (define-key mac-raw-map "\001" ".") ; keypad .
  33. (define-key mac-raw-map "\002" 'forward-char) ; non-ADB right cursor
  34. (define-key mac-raw-map "\003" "*") ; keypad *
  35. (define-key mac-raw-map "\004" nil) ; no such key
  36. (define-key mac-raw-map "\005" "+") ; keypad +
  37. (define-key mac-raw-map "\006" 'backward-char) ; non-ADB left cursor
  38. (define-key mac-raw-map "\007" 'apple-clear) ; clear
  39. (define-key mac-raw-map "\010" 'next-line) ; non-ADB down cursor
  40. (define-key mac-raw-map "\011" nil) ; no such key
  41. (define-key mac-raw-map "\012" nil) ; no such key
  42. (define-key mac-raw-map "\013" "/") ; keypad /
  43. (define-key mac-raw-map "\014" "\n") ; enter
  44. (define-key mac-raw-map "\015" 'previous-line) ; non-ADB up cursor
  45. (define-key mac-raw-map "\016" "-") ; keypad -
  46. (define-key mac-raw-map "\017" nil) ; no such key
  47. (define-key mac-raw-map "\020" nil) ; no such key
  48. (define-key mac-raw-map "\021" "=") ; keypad =
  49. (define-key mac-raw-map "\022" "0") ; keypad 0
  50. (define-key mac-raw-map "\023" "1") ; keypad 1
  51. (define-key mac-raw-map "\024" "2") ; keypad 2
  52. (define-key mac-raw-map "\025" "3") ; keypad 3
  53. (define-key mac-raw-map "\026" "4") ; keypad 4
  54. (define-key mac-raw-map "\027" "5") ; keypad 5
  55. (define-key mac-raw-map "\030" "6") ; keypad 6
  56. (define-key mac-raw-map "\031" "7") ; keypad 7
  57. (define-key mac-raw-map "\032" 'nil) ; no such key
  58. (define-key mac-raw-map "\033" "8") ; keypad 8
  59. (define-key mac-raw-map "\034" "9") ; keypad 9
  60. (define-key mac-raw-map "\035" 'nil) ; no such key
  61. (define-key mac-raw-map "\036" 'nil) ; no such key
  62. (define-key mac-raw-map "\037" 'nil) ; no such key
  63. (define-key mac-raw-map "\040" 'nil) ; F5
  64. (define-key mac-raw-map "\041" 'nil) ; F6
  65. (define-key mac-raw-map "\042" 'nil) ; F7
  66. (define-key mac-raw-map "\043" 'apple-copy) ; F3, copy
  67. (define-key mac-raw-map "\044" 'nil) ; F8
  68. (define-key mac-raw-map "\045" 'nil) ; F9
  69. (define-key mac-raw-map "\046" 'nil) ; F13
  70. (define-key mac-raw-map "\047" 'nil) ; F11
  71. (define-key mac-raw-map "\050" 'nil) ; no such key
  72. (define-key mac-raw-map "\051" 'nil) ; F13
  73. (define-key mac-raw-map "\052" 'nil) ; no such key
  74. (define-key mac-raw-map "\053" 'nil) ; F14
  75. (define-key mac-raw-map "\054" 'nil) ; no such key
  76. (define-key mac-raw-map "\055" 'nil) ; F10
  77. (define-key mac-raw-map "\056" 'nil) ; no such key
  78. (define-key mac-raw-map "\057" 'nil) ; no such key
  79. (define-key mac-raw-map "\060" 'nil) ; no such key
  80. (define-key mac-raw-map "\061" 'nil) ; F15
  81. (define-key mac-raw-map "\062" 'help-for-help) ; help
  82. (define-key mac-raw-map "\063" 'beginning-of-buffer) ; home
  83. (define-key mac-raw-map "\064" 'scroll-down) ; page up
  84. (define-key mac-raw-map "\065" 'delete-char) ; del
  85. (define-key mac-raw-map "\066" 'apple-paste) ; F4, paste
  86. (define-key mac-raw-map "\067" 'end-of-buffer) ; end
  87. (define-key mac-raw-map "\070" 'apple-cut) ; F2, cut
  88. (define-key mac-raw-map "\071" 'scroll-up) ; page down
  89. (define-key mac-raw-map "\072" 'apple-undo) ; F1, undo
  90. (define-key mac-raw-map "\073" 'backward-char) ; left cursor
  91. (define-key mac-raw-map "\074" 'forward-char) ; right cursor
  92. (define-key mac-raw-map "\075" 'next-line) ; down cursor
  93. (define-key mac-raw-map "\076" 'previous-line) ; up cursor
  94. (define-key mac-raw-map "\077" 'nil) ; power switch
  95. (define-key mac-raw-map "\102" "*") ; non-ADB keypad *
  96. (define-key mac-raw-map "\106" "+") ; non-ADB keypad +
  97. (define-key mac-raw-map "\110" "=") ; non-ADB keypad =
  98. (define-key mac-raw-map "\115" "/") ; non-ADB keypad /
  99.  
  100. (define-key ctl-x-map "*" mac-raw-map)
  101.  
  102. ;;; Since .emacs gets loaded before this file, a hook is supplied
  103. ;;; for you to put your own bindings in.
  104.  
  105. (defvar mac-raw-map-hooks nil
  106.   "List of forms to evaluate after setting mac-raw-map.
  107. This list is processed by: (mapcar 'eval mac-raw-map-hooks)")
  108.  
  109. (mapcar 'eval mac-raw-map-hooks)
  110.